﻿// See https://aka.ms/new-console-template for more information
List<user> list = new List<user>();
int i = 0;
while (i <= 5)
{
    i++;
    user obj = new user() { id = 1 };
    list.Add(obj);
}

foreach (var item in list)
{
    item.id++;
    Console.WriteLine(item.id);
}

internal class user
{
    public int id { get; set; }
}